package com.dancun.controller;


import com.dancun.entity.CTask;
import com.dancun.entity.TResult;
import com.dancun.service.ITResultService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author jobob
 * @since 2020-10-02
 */
@RestController
public class TResultController {
    @Autowired
    ITResultService tResultService;

    @PostMapping("saveResult")
    public String save(TResult tResult) {
        TResult t = tResultService.find(tResult);
        tResult.setId(t.getId());
        if (t != null) {
            tResultService.updateById(tResult);
        } else {
            tResultService.save(tResult);
        }
        return null;
    }




}
